<h2 class="grid_12">Listado de denuncias de servicios</h2>
<div class="grid_12">
   <div class="box">
      <div class="header">
      <?php echo $this->Html->image('icons/packs/fugue/16x16/shadeless/table-excel.png', array("width"=>16, "height"=>16));?>
      <h3>servicios</h3><span></span>
      </div><!--end of header-->
      <div class="content">
         <table id="table-example" class="table">
            <thead>
               <tr>
                  <th>NumReg</th>
                  <th>Propietario macho</th>
                  <th>Propietario hembra</th>
                  <th>Macho</th>
                  <th>Hembra</th>
                  <th>Acciones</th>
               </tr>
            </thead><!--end of thead table-->
            <tbody>
              <?php $i=0;?>
              <?php foreach($denuncias as $denuncia):?>
                                    
              <tr <?php echo fmod($i, 2) ? "class = gradeX" : "gradeA";?>>
              <?php $i++;?>
              <td class="center"><?php echo $denuncia['Servicio']['id']?></td>
              <td><?php echo $denuncia['Propietarioreproductor']['nombre']?></td>
              <td><?php echo $denuncia['Propietarioreproductora']['nombre']?></td>
              <td class="center"><?php echo $denuncia['Reproductor']['nombre']?></td>
              <td class="center"><?php echo $denuncia['Reproductora']['nombre']?></td>
              <td>
              <?php 
              echo $this->Html->link(
              $this->Html->image("icons/packs/diagona/16x16/018.png", array("alt" => "Editar")),
              array('action'=>"editar",$denuncia['Servicio']['id']),
              array('escape' => false)
              );
              ?>
              &nbsp;
               <?php echo $this->Html->link(
              $this->Html->image("icons/packs/diagona/16x16/049.png", array("alt"=>"ver")),
              array('action'=>"ver",$denuncia['Servicio']['id']),
              array('escape' => false)
              ); ?>
              &nbsp;
              <?php echo $this->Html->link(
              $this->Html->image("icons/packs/diagona/16x16/101.png", array("title"=>"eliminar")),
              array('action'=>"eliminar",$denuncia['Servicio']['id']),
              array('escape' => false),
              ('Desea realmente eliminar?')
              ); ?>
              &nbsp;
              <?php 
              echo $this->Html->link(
              $this->Html->image("icons/packs/diagona/16x16/062.png", array("title"=>"imprimir")), 
              array('action' => 'imprimir', $denuncia['Servicio']['id']),
              array('escape' => false)
              ); ?>
              &nbsp;
              <?php if($denuncia['Denuncianacimiento']['servicio_id'] == null):?>
              <?php 
              echo $this->Html->link(
              $this->Html->image("icons/packs/diagona/16x16/002.png", array("title"=>"registrar nacimiento")), 
              array('action' => 'denuncia', 'controller'=>'dnacimiento', $denuncia['Servicio']['id']),
              array('escape' => false)
              ); ?>
              <?php else:?>
              <?php 
              echo $this->Html->link(
              $this->Html->image("icons/packs/diagona/16x16/164.png", array("title"=>"ver nacimiento")), 
              array('action' => 'ver', 'controller'=>'dnacimiento', $denuncia['Denuncianacimiento']['id']),
              array('escape' => false)
              ); ?>
              <?php
              //debug($denuncia['Denuncianacimiento']['id']);
              if($denuncia['Camada']['id'] == null){
                echo $this->Html->link(
                $this->Html->image("dogver.png", array("title"=>"registrar camada")), 
                array('controller'=>'Denunciaservicio', 'action' => 'registrarcamada', $denuncia['Servicio']['id'], $denuncia['Denuncianacimiento']['id']),
                array('escape' => false)
                );
              }else{
                echo $this->Html->link(
                $this->Html->image("dog.png", array("title"=>"ver datos camada")), 
                array('controller'=>'Denunciaservicio', 'action' => 'vercamada', $denuncia['Camada']['id']),
                array('escape' => false)
                );
              }
              
              ?>
              <?php endif;?>
              </td>
              </tr>
              <?php endforeach;?>
            </tbody>
         </table><!--end of table-->
      </div><!--end of content-->
      <div class="clear"></div>
   </div><!--end of box-->
</div><!--end of grid 12 contendedor tabla-->
<div class="grid_4">
      <div id="blocks" class="box tabbed">
        <div class="header">
        <h3>Acciones</h3>
        </div>
        <div class="content">
          <ul id="block-list-icons" class="block-list with-icon tab-content">
            <li class="i-16-calendar">Lista Denuncias</li>
            <li class="i-16-application">
            <?php echo $this->Html->link('Registrar Nuevo Denuncia',array('controller'=>'denunciaservicio','action'=>'insertarservicio'))?>
            </li>
            <li class="i-16-drive">Imprimir</li>
            <li class="i-16-chart">Reportes</li>
            <li class="i-16-balloon">Lorem ipsum</li>
          </ul>
        </div> <!-- End of .content -->
        </div> <!-- End of .box -->
</div> <!-- End of .grid_4 -->
<div class="clear"></div> 
</div>
<script defer>
      $(window).load(function() {
        $('#table-example').dataTable();
        $(window).resize();
      });
</script>